package datasv.courseSelect_datasv;

import java.util.ArrayList;
import java.util.List;

import data.datafactory.DatabaseOperator;
import po.SelectRecordPO;

public class GetStudentSecRecord {
	public static void main(String[] args) {
		System.out.println(new GetStudentSecRecord().getStudentSecRecord("001131001"));
	}
	public List<SelectRecordPO> getStudentSecRecord(String studentID){
		return getInSql(studentID);
	}
	private List<SelectRecordPO> getInSql(String studentID){
		DatabaseOperator op=new DatabaseOperator("college");
		ArrayList<SelectRecordPO> list=new ArrayList<SelectRecordPO>();
		ArrayList<String> listID=op.getColumn("course_select_record", "id");
		for (int i = 0; i < listID.size(); i++) {
			String m=op.getOneInform(listID.get(i), "course_select_record", "studentID");
			if(m.equals(studentID)){
				list.add(new SelectRecordPO(listID.get(i), studentID));
			}
		}
		return list;
	}
}
